cmake_minimum_required (VERSION 2.8)
set(APPNAME gb28181)
if(CROSS_COMPILE)
  set(CMAKE_C_COMPILER ${CROSS_COMPILE}-gcc)
  set(CMAKE_CXX_COMPILER ${CROSS_COMPILE}-g++)
  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
  set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
endif()
project(${APPNAME})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/md5)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/linux )

aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src DIR_SRCS)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/md5 DIR_SRCS)
add_executable(${APPNAME} ${DIR_SRCS})
target_link_libraries(${APPNAME} eXosip2 osip2 osipparser2 pthread)

foreach(f IN LISTS DIR_SRCS)
  get_filename_component(b ${f} NAME)
  set_source_files_properties(${f} PROPERTIES
    COMPILE_DEFINITIONS "__FILENAME__=\"${b}\"")
endforeach()
